<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        /*
            给定一个整数数组nums和一个整数目标值target，
            请你在该数组中找出和为目标值target的那两整数，
            并返回它们的数组下标。
        */
        //    选择排序
        var twoSum = function (nums, target) {
            let len = nums.length;
            for (let i = 0; i < len - 1; i++) {
                for (let j = i + 1; j < len; j++) {
                    if (nums[i] + nums[j] == target) {
                        return [i, j];
                    }
                }
            }
        };
    </script>
</head>

<body>

</body>

</html>